from django.conf.urls import url, include
from django.contrib import admin
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    #用户名
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsername.as_view(),name='usernamecount'),
    #手机
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$',views.RegisterUsermobile.as_view(),name='usermobile'),
    #注册
    url(r'^$',views.RegisterCreateView.as_view()),
    #登录
    #默认返回值只有token
    url(r'^auths/$',obtain_jwt_token,name='auths'),
    #用户详情
    url(r'^infos/$',views.UserDetailView.as_view()),
    #邮箱
    url(r'^emails/$',views.EmailView.as_view()),

    url(r'^list/$',views.UserListView.as_view()),
    #邮箱验证
    url(r'^emails/verification/$',views.VerificationEmailView.as_view()),

]